package com.bite.common.core.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

// 响应状态码
@AllArgsConstructor
@Getter
public enum ResultCode {
    //操作唱功
    SUCCESS (1000, "操作成功"),


    //服务器内部错误，友好提⽰
    ERROR (2000, "服务繁忙请稍后重试"),


    //操作失败，但是服务器不存在异常
    FAILED (3000, "操作失败"),
    FAILED_UNAUTHORIZED (3001, "未授权"),
    FAILED_PARAMS_VALIDATE (3002, "参数校验失败"),
    FAILED_NOT_EXISTS (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS (3004, "资源已存在"),


    /** C端用户异常 **/
    AILED_USER_EXISTS (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS (3102, "用户不存在"),
    FAILED_LOGIN (3103, "用户名或密码错误"),
    FAILED_USER_BANNED (3104, "您已被列⼊⿊名单, 请联系管理员."),
    FAILED_USER_PHONE (3105, "手机号不正确"),
    FAILED_SEND_FREQUENT(3106, "发送太频繁，请稍后再重试"),
    FAILED_SEND_CODE (3107, "验证码发送失败"),
    FAILED_REACH_LIMIT_TIME(3108, "今日请求次数达到限制，请择日再来"),
    FAILED_CODE_INVALID(3109, "验证码已过期，请重新发送验证码"),
    FAILED_CODE_ERROR(3110, "验证码错误"),
    FAILED_MESSAGE_NOT_EXIST(3111, "消息不存在"),
    FAILED_USER_ENTER_EXAM(3112, "已经参加了该竞赛，无需重复报名"),
    FAILED_USER_GROUP_EMPTY(3113, "用户组不能为空"),
    FAILED_USER_GROUP_NICKNAME_EMPTY(3114, "用户组昵称不能为空"),
    FAILED_USER_GROUP_INTRODUCE_EMPTY(3115, "用户组简介不能为空"),
    FAILED_USER_GROUP_NICKNAME_REPEAT(3116, "用户组昵称不能重复"),


    /** 竞赛异常 **/
    EXAM_START_TIME_BEFORE_CURRENT_TIME(3201, "竞赛开始时间不能在当前时间之前"),
    EXAM_END_TIME_AFTER_START_TIME(3202, "竞赛结束时间在开始时间之后"),
    EXAM_NOT_EXISTS(3203, "竞赛不存在"),
    EXAM_QUESTION_NOT_EXISTS(3204, "竞赛添加的题目不能为空"),
    EXAM_QUESTION_ILLEGAL(3205, "竞赛添加的题目参数不合法"),
    EXAM_TITLE_REPEAT(3206, "竞赛标题已存在"),
    EXAM_STARTED(3207, "竞赛已开赛，不能再经行操作"),
    EXAM_NOT_QUESTION(3208, "竞赛中没有题目信息"),
    EXAM_PUBLISH(3209, "竞赛已发布，不能再经行操作"),
    EXAM_TYPE_IS_PUBLIC(3210, "竞赛是公共的 不能添加用户组"),
    EXAM_TYPE_CHANGE(3211, "竞赛是不能改变类型"),




    /** 文件异常 **/
    FAILED_FILE_UPLOAD_TIME_LIMIT(3401, "文件上传次数已达到上线，请择日再重试"),
    FAILED_FILE_UPLOAD(3402, "文件上传失败"),
    FAILED_FILE_EMPTY(3403, "文件为空"),

    /** 题目异常 **/
    FIRST_QUESTION(3501, "当前题目是第一道"),
    LAST_QUESTION(3502, "当前题目是最后一道"),
    QUESTION_NOT_EXIST(3503, "当前题目不存在，请换一道题目"),
    QUESTION_MAIN_CODE_ERROR(3504, "题目主函数错误 请联系管理员"),


    /** 判题异常 **/
    JUDGE_NOT_SUPPORT(3601, "当前代码类型暂不支持"),
    ;

    private final int code;
    private final String msg;
}
